//
//  ViewController.m
//  折线图
//
//  Created by iOS on 16/6/28.
//  Copyright © 2016年 iOS. All rights reserved.
//

#import "ViewController.h"
#import "ZXView.h"
@interface ViewController ()

@end

@implementation ViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    self.view.backgroundColor = [UIColor grayColor];
    ZXView * zx = [[ZXView alloc]initWithFrame:CGRectMake(10, 100, [UIScreen mainScreen].bounds.size.width - 20, 250)];
    //横纵坐标赋值
    zx.horizontalDateArray = @[@"1H",@"2H",@"3H",@"4H",@"5H",@"6H",@"7H",@"8H",@"9H"];
    zx.verticalDateArray = @[@"300",@"200",@"100",@"0",@"-100"];
    //背景颜色
    zx.gradientLayerColors = [NSMutableArray arrayWithArray:@[(__bridge id)[UIColor colorWithRed:253 / 255.0 green:164 / 255.0 blue:8 / 255.0 alpha:1.0].CGColor, (__bridge id)[UIColor colorWithRed:251 / 255.0 green:37 / 255.0 blue:45 / 255.0 alpha:1.0].CGColor]];
//    [self.view addSubview:zx];
//    zx.gradientLayerColors = [NSMutableArray arrayWithArray:@[(__bridge id)[UIColor blueColor].CGColor,(__bridge id)[UIColor whiteColor].CGColor]];
    
    //设置折线颜色
  //  zx.LineColor = [UIColor greenColor];
    zx.lineColorArray = @[ [UIColor greenColor],[UIColor blueColor],[UIColor purpleColor]];
    
    //设置折线的数据源
    zx.dataArray = @[@[@(arc4random()%300),@(arc4random()%300),@(arc4random()%300),@(arc4random()%300),@(arc4random()%300),@(arc4random()%300),@(-50),@(0),@(arc4random()%300)],
  @[@(-36),@(arc4random()%300),@(arc4random()%300),@(arc4random()%300),@(-54),@(arc4random()%300),@(arc4random()%300),@(arc4random()%300),@(arc4random()%300)],@[@(arc4random()%300),@(arc4random()%300),@(arc4random()%300),@(-20),@(arc4random()%300),@(-79),@(arc4random()%300),@(arc4random()%300),@(arc4random()%300)]];
    
    //设置line名称
    zx.lineNameArray = @[@"第一",@"第二",@"第三"];
    
    [self.view addSubview:zx];
    // Do any additional setup after loading the view, typically from a nib.
    
    
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

@end
